<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class AddIndexIdxTypeRoleUserIdTypeIdInMemberTable extends AbstractMigration
{
    public function up()
    {
        $this->table('member')
            ->addIndex(['type', 'role', 'user_id', 'type_id', 'tenant_id'], ['unique' => 'true', 'name' => 'idx_type_role_user_id_type_id'])
            ->save();
    }

    public function down()
    {
        $this->table('member')->removeIndexByName('idx_type_role_user_id_type_id')->save();
    }
}
